package com.learn.springboot.controller.rest;

import com.learn.springboot.entity.pojo.UmsAdmin;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * @author wangxing
 * @version 2020/8/3 10:41 Administrator
 */
@RestController
@RequestMapping("/rest")
public class RestApiController {
    @GetMapping("/select/{id}")
    public UmsAdmin selectById(@PathVariable("id") Long id){
        UmsAdmin umsAdmin = new UmsAdmin();
        umsAdmin.setId(id);
        umsAdmin.setNickName("WangXing");
        umsAdmin.setCreateTime(new Date());
        umsAdmin.setEmail("as080904@163.com");
        return umsAdmin;
    }
    @PostMapping("/insert")
    public String insert(UmsAdmin umsAdmin){
        System.out.println(umsAdmin);
        return "umsAdmin";
    }
}
